package com.QK.cnstudy;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.app.Activity;
import android.os.Bundle;
import android.text.Html;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.TextView;

import com.QK.cnstudy.adapter.TestAdapter;

public class SettingActivity extends Activity implements OnItemClickListener {

    private TestAdapter adapter;
    private ListView listView = null;
    private List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();

    private TextView aboutTextView;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.setting);

        getView();
        setListViewData();

        adapter = new TestAdapter(this, list);
        listView.setAdapter(adapter);
        listView.setOnItemClickListener(this);

        // setAbout();
    }

    public void getView() {
        listView = (ListView) findViewById(R.id.test_list);
        // aboutTextView = (TextView) findViewById(R.id.about);
    }

    public void setAbout() {
        String htmlString = "<font  color = \"black\">关于我们<br/><br/>"
                        + "‘简单可依赖，高考加10分’<br/><br/>"
                        + "目前文言文占了高考总分20分以上，但由于考试范围只出现在教材内，所以学好文言文并不困难。‘文言文学习’是中国的第一款与教材同步的学习工具。同学们可通过对句子和字词的学习与实践，降低‘错误率’。另外，我们利用网络实时统计易错题，并提供给大家。<br/><br/>"
                        + "‘文言文学习’内容同步于2012版人教版、苏教版、语文版。小组成员包括南开大学中文系、汉语水平考试HSK前成员、101中学语文组、经验丰富的App设计师等。<br/><br/>"
                        + "请关注我们新浪微博：@文言文学习<br/><br/>" + "http://weibo.com/classicchinese<br/><br/>"
                        + "如有建议意见，请发邮件到：<br/><br/>" + "iwenyan@163.com<br/><br/>"
                        + "一旦您的建议被采纳，我们将给您准备神秘的礼物~！<br/><br/>" + "文言文学习 工作室<br/><br/>";

        aboutTextView.setText(Html.fromHtml(htmlString));
    }

    public void setListViewData() {
        Map<String, Object> map1 = new HashMap<String, Object>();
        map1.put("title", "学习资料");
        Map<String, Object> map2 = new HashMap<String, Object>();
        map2.put("title", "小测设置");

        list.add(map1);
        list.add(map2);

    }

    @Override
    public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
        // TODO Auto-generated method stub

    }

}
